package com.jcsz.gulimall.cart.config;

import com.jcsz.gulimall.cart.interceptor.CartInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @className: GulimallWebConfig
 * @author: 一把Po吉他
 * @date: 2022/11/10 13:58
 * @version: 1.0
 **/
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    @Autowired
    CartInterceptor cartInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(cartInterceptor).addPathPatterns("/**");
    }
}
